home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 June / 1993-06.d64 / usr prt clock.bb (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  40 lines

  1. 40 printchr$(147):poke53281,14:poke646,6
  2. 50 print"set clock at:"
  3. 60 r=8:gosub290:k=43200
  4. 70 ifi$="pm"thenx=k
  5. 80 fori=1to3:h=int(t(i)/10):l=t(i)-10*h:t(i)=16*h+l:next
  6. 90 c=56331:pokec,t(1):pokec-1,t(2):pokec-2,t(3)
  7. 100 print"activate user port at:"
  8. 110 r=18:gosub290
  9. 120 ifi$="pm"theny=k
  10. 130 b=y+t(1)*3600+t(2)*60+t(3)
  11. 140 print"press any key to start clock.
  12. 150 [161]a$:[139]a$[178]""[167]150
  13. 160 [151]c[171]3,0
  14. 170 h[178][194](c):m[178][194](c[171]1):s[178][194](c[171]2):t[178][194](c[171]3)
  15. 180 c1$[178][199]((16[175]h)[173]16[170]48)[170][199]((15[175]h)[170]48)
  16. 190 h[178][197](c1$)[172]3600
  17. 200 [139]c1$[178]"00"[167]c1$[178]"12"
  18. 210 c2$[178][199]((240[175]m)[173]16[170]48)[170][199]((15[175]m)[170]48):m[178][197](c2$)[172]60
  19. 220 c3$[178][199]((240[175]s)[173]16[170]48)[170][199]((15[175]s)[170]48):s[178][197](c3$)
  20. 230 a[178]x[170]h[170]m[170]s:[139]a[178]2[172]k[167][151]c,0:[151]c[171]3,0:x[178]0
  21. 240 [139]a[178]b[167]420
  22. 250 [139]a[179]k[167]j$[178]"am":[137]270
  23. 260 j$[178]"pm"
  24. 270 [153]"time is "c1$[170]":"[170]c2$[170]":"[170]c3$[170]":"t;j$[170]"on"
  25. 280 [137]170
  26. 290 h$[178]"":[133]"hours";h$:[139]h$[179]"0"[176]h$[177]"9"[167][153]"onon":[137]290
  27. 300 t(1)[178][197](h$):[139]t(1)[179]0[176]t(1)[177]12[167][153]"onon":[137]290
  28. 310 [139]t(1)[178]12[167]t(1)[178]0
  29. 320 m$[178]"":[133]"minutes";m$:[139]m$[179]"0"[176]m$[177]"9"[167][153]"ononon":[137]320
  30. 330 t(2)[178][197](m$):[139]t(2)[179]0[176]t(2)[177]59[167][153]"ononon":[137]320
  31. 340 s$[178]"":[133]"seconds";s$:[139]s$[179]"0"[176]s$[177]"9"[167][153]"ononon":[137]340
  32. 350 t(3)[178][197](s$):[139]t(3)[179]0[176]t(3)[177]59[167][153]"ononon":[137]340
  33. 360 [153]"am or pm (press a or p)"
  34. 370 [161]i$:[139]i$[179][177]"a"[167][139]i$[179][177]"p"[167]370
  35. 380 [139]i$[178]"a"[167]i$[178]"am":[137]400
  36. 390 i$[178]"pm"
  37. 400 [151]214,r:[153]:[151]211,24:[153]i$
  38. 410 [142]
  39. 420 [153]"loaduser port activated."
  40.